import Layout from '@/layout'
import EmptyLayout from '@/layout/empty'

export default {
    path: '/system',
    component: Layout,
    redirect: '/system/account',
    name: 'system',
    meta: {
        title: '系统管理',
        icon: 'system-nav-icon'
    },
    children: [
        {
            path: 'account',
            name: 'account',
            component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/account/index'),
            meta: {
                title: '账户管理',
                auth: ['account.browse']
            }
        },
        {
            path: 'role',
            name: 'role',
            component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/role/index'),
            meta: {
                title: '角色管理',
                auth: ['role.browse']
            }
        },
        {
            path: 'auth',
            name: 'auth',
            component: EmptyLayout,
            redirect: '/auth',
            meta: {
                title: '权限管理',
                auth: ['auth.browse']
            },
            children: [
                {
                    path: '',
                    component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/auth/index'),
                    meta: {
                        title: '权限管理',
                        sidebar: false,
                        breadcrumb: false
                    }
                },
                {
                    path: 'add',
                    name: 'authAdd',
                    component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/auth/detail'),
                    meta: {
                        title: '新增权限',
                        sidebar: false,
                        activeMenu: '/system/auth'
                    }
                },
                {
                    path: 'edit/:id',
                    name: 'authEdit',
                    component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/auth/detail'),
                    meta: {
                        title: '编辑权限',
                        sidebar: false,
                        activeMenu: '/system/auth'
                    }
                }
            ]
        }
        // {
        //     path: 'businessAuth',
        //     name: 'businessAuth',
        //     component: EmptyLayout,
        //     redirect: '/businessAuth',
        //     meta: {
        //         title: '商家权限',
        //         auth: ['businessAuth.browse']
        //     },
        //     children: [
        //         {
        //             path: '',
        //             component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/businessAuth/index'),
        //             meta: {
        //                 title: '商家权限',
        //                 sidebar: false,
        //                 breadcrumb: false
        //             }
        //         },
        //         {
        //             path: 'add',
        //             name: 'authAdd',
        //             component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/businessAuth/detail'),
        //             meta: {
        //                 title: '新增商家权限',
        //                 sidebar: false,
        //                 activeMenu: '/system/businessAuth'
        //             }
        //         },
        //         {
        //             path: 'edit/:id',
        //             name: 'authEdit',
        //             component: () => import(/* webpackChunkName: 'system_manage' */ '@/views/system_manage/businessAuth/detail'),
        //             meta: {
        //                 title: '编辑商家权限',
        //                 sidebar: false,
        //                 activeMenu: '/system/businessAuth'
        //             }
        //         }
        //     ]
        // },
    ]
}
